import { createRouter, createWebHistory } from 'vue-router'
export const routes = [
  {
    path: '/',
    name: 'home',
    label: '首页',
    icon: 'SwitchFilled',
    component: () => import('@/views/HomeView.vue'),
    redirect: '/findmusic',
    children: [
      {
        path: 'findmusic',
        name: 'findmusic',
        label: '发现音乐',
        icon: 'SwitchFilled',
        component: () => import('@/views/FindMusicView.vue'),
      },
      {
        path: 'personalindex',
        name: 'personalindex',
        label: '用户动态',
        icon: 'User',
        component: () => import('@/views/userDetails/PersonalIndexView.vue'),
        redirect: '/personalindex/personalevent',
        children: [
          {
            path: 'personal',
            name: 'personal',
            label: '个人资料',
            icon:'Setting',
            component: () => import('@/views/userDetails/PersonalView.vue'),
            redirect: '/personalindex/personal/personalinfosettings',
            children: [
              {
                path: 'personalinfosettings',
                name: 'personalinfosettings',
                label: '个人设置',
                component: () => import('@/views/userDetails/PersonalInfoSettingsView.vue'),
              },

            ]
          },
          {
            path: 'userinfo',
            name: 'userinfo',
            label: '我的关注',
            icon: 'Connection',
            component: () => import('@/views/userDetails/UserInfoView.vue'),
          },
          {
            path: 'personalevent',
            name: 'personalevent',
            label: '动态详情',
            icon: 'ChromeFilled',
            component: () => import('@/views/userDetails/PersonalEventView.vue'),
          }
        ]
      },
      {
        path: 'searchindex',
        name: 'searchindex',
        label: '搜索相关',
        icon: 'Search',
        component: () => import('@/views/search/SearchIndexView.vue'),
        redirect: '/searchindex/search',
        children: [
          {
            path: 'search',
            name: 'search',
            label: '搜索详情',
            icon:'Tickets',
            component: () => import('@/views/search/SearchView.vue'),
          }
        ]
      },
      {
        path: 'recommendindex',
        name: 'recommendindex',
        label: '推荐相关',
        icon: 'Promotion',
        component: () => import('@/views/recommend/RecommendIndexView.vue'),
        redirect: '/recommendindex/recommendday',
        children: [
          {
            path: 'recommendday',
            name: 'recommendday',
            label: '每日推荐',
            icon: 'Headset',
            component: () => import('@/views/recommend/RecommendDayView.vue'),
          },
          {
            path: 'djprogram',
            name: 'djprogram',
            label: '推荐电台',
            icon: 'Headset',
            redirect: '/recommendindex/djprogram/djprogramIndex',
            component: () => import('@/views/recommend/RecommendDJIView.vue'),
            children: [
              {
                path: 'djprogramIndex',
                name: 'djprogramIndex',
                label: '电台节目',
                redirect: '/recommendindex/djprogram/djprogramIndex/djprogramWatch',
                children: [
                  {
                    path: 'djprogramWatch',
                    name: 'djprogramWatch',
                    label: '电台节目浏览',
                    component: () => import('@/views/dj/djProgramDetailView.vue'),
                  },
                  {
                    path: 'djprogramDetail',
                    name: 'djprogramDetail',
                    label: '电台节目详情',
                    component: () => import('@/views/dj/djProgramView.vue'),
                  },
                ]

              }
            ],
          },

          {
            path: 'recommendnewsong',
            name: 'recommendnewsong',
            label: '推荐新音乐',
            icon: 'Service',
            component: () => import('@/views/recommend/RecommendNewSongView.vue'),
          },
          {
            path: 'RecommendMVSView',
            name: 'RecommendMVSView',
            label: '推荐MV',
            icon: 'VideoCameraFilled',
            component: () => import('@/views/recommend/RecommendMVSView.vue'),
            redirect: { name: "recommendMV" },
            children: [{
              path: '/RecommendMVSView/recommendMV',
              name: 'recommendMV',
              label: 'MV列表',
              component: () => import('@/views/recommend/RecommendMVView.vue'),
            },
            {
              path: '/RecommendMVSView/recommendMVdetails',
              name: 'recommendMVdetails',
              label: 'MV详情',
              component: () => import('@/views/recommend/RecommendMVDetailsView.vue'),
            }]

          }

        ]
      },
      {
        path: 'userevent',
        name: 'userevent',
        label: '热门歌单',
        icon: 'ChatDotRound',
        component: () => import('@/views/userevent/UserEventIndexView.vue'),
        redirect: '/userevent/usereventdetails',
        children: [
          {
            path: 'usereventdetails',
            name: 'usereventdetails',
            label: '歌单详情',
            icon:'List',
            component: () => import('@/views/userevent/HighqualityTags.vue'),
            redirect: '/userevent/usereventdetails/highqualitytagsofone',
            children: [
              {
                path: 'highqualitytagsofone',
                name: 'highqualitytagsofone',
                label: '歌单标签',
                component: () => import('@/views/userevent/HighqualityTagsOfOne.vue'),
              },
              {
                path: 'gettagsofmusics',
                name: 'gettagsofmusics',
                label: '歌曲标签',
                component: () => import('@/views/userevent/GetTagsOfMusics.vue'),
              }
            ]
          }
        ]
      },
      {
        path: 'userplaylistindex',
        name: 'userplaylistindex',
        label: '用户歌单',
        icon: 'Histogram',
        component: () => import('@/views/playlist/UserPlaylistIndexView.vue'),
        redirect: '/userplaylistindex/userlikeslist',
        children: [
          {
            path: 'usersonglist',
            name: 'usersonglist',
            label: '用户歌单列表',
            icon: 'Memo',
            component: () => import('../views/playlist/UserSongListView.vue')
          },
          {
            path: 'userlikeslist',
            name: 'userlikeslist',
            label: '喜欢音乐首页',
            icon: 'Star',
            component: () => import('@/views/playlist/UserLikesListView.vue'),
            redirect: '/userplaylistindex/userlikeslist/userlikessongs',
            children: [
              {
                path: 'userlikessongs',
                name: 'userlikessongs',
                label: '我喜欢的音乐',
                component: () => import('@/views/playlist/UserLikesSongsView.vue')
              },
              {
                path: 'userlikesdetails/:songId',
                name: 'userlikesdetails',
                label: '我喜欢的音乐详情',
                component: () => import('@/views/playlist/UserLikesDetailsView.vue'),
              }

            ]
          },

        ]
      },
    ]
  },
  {
    path: '/404',
    name: '404',
    component: () => import('@/views/NotFoundView.vue')
  },
  {
    path: '/:catchAll(.*)*',
    redirect: '/404'
  }

]
const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes

})


export default router
